﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Debug;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccess
{
    public class MyPetHubContext : DbContext
    {
        public DbSet<MerchantInfo> MerchantInfo { get; set; }
        public DbSet<MerchantInfoHeap> MerchantInfoHeap { get; set; }
        public DbSet<SysUser> SysUser { get; set; }
        public DbSet<PetInfo> PetInfo { get; set; }
        public DbSet<AdvertInfo> AdvertInfo { get; set; }
        public DbSet<PetStory> PetStory { get; set; }
        public DbSet<SpeciesInfo> SpeciesInfo { get; set; }
        public DbSet<PetKnowledge> PetKnowledge { get; set; }
        public DbSet<ReadCountHeap> ReadCountHeap { get; set; }
        public DbSet<StatisticsInfo> StatisticsInfo { get; set; }
        public DbSet<PetFosterage> PetFosterage { get; set; }
        public DbSet<AboutUS> AboutUS { get; set; }
        public DbSet<BreedInfo> BreedInfo { get; set; }

        public MyPetHubContext(DbContextOptions<MyPetHubContext> options) : base(options) {}

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            //modelBuilder.Entity<ConcurrencyTest>().HasKey(x => x.concurrencytestid).Property(x => x.rowversion).IsConcurrencyToken();
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
        }
    }
}
